package com.zhumo.sz.entity.bus;

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.ArrayList;

public class TestRead {

    public static void main(String[] args) {

        ArrayList<BusLineExcel> arrayList = new ArrayList<>();
        EasyExcel.read("D:\\model\\sz-bigdata\\data\\深圳公交数据.xlsx", BusLineExcel.class, new AnalysisEventListener<BusLineExcel>() {
            @Override
            public void invoke(BusLineExcel busLineExcel, AnalysisContext analysisContext) {
                // 将读取到的每一行存入reportDetails集合中
                arrayList.add(busLineExcel);
            }
            @Override
            public void doAfterAllAnalysed(AnalysisContext analysisContext) {}
        }).sheet().doRead();

        System.out.println(arrayList);
    }
}
